package org.yangjie.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.yangjie.service.AuthService;

/**
 * 自定义登录认证功能
 * 认证成功后将用户信息放入当前线程上下文环境
 * 也就不需要org.springframework.security.core.userdetails.UserDetailsService
 * @author YangJie [2019年1月21日]
 */
@RestController
public class AuthController {
	
	@Autowired
	private AuthService authService;

	
	@RequestMapping("/auth")
	public String auth(){ // 模拟登录成功, 返回token
		return authService.auth();
	}
	
}
